package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.MemberReservation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface MemberReservationMapper extends BaseMapper<MemberReservation> {
    /**
     * 查询取消预约数量
     * */
    Integer selectCancelCountsById(@Param("startTime") LocalDateTime startTime,
                                   @Param("endTime") LocalDateTime endTime,
                                   @Param("userId") Long userId);

    /**
     * 查询每个时间段剩余预约次数
     * */
    List<Map<String, Object>> countByTime(@Param("startTime") LocalDateTime startTime,
                                          @Param("endTime")LocalDateTime endTime);
}
